package me.gijspennings.jumpandduck.entity.mob;

import me.gijspennings.jumpandduck.entity.Entity;
import me.gijspennings.jumpandduck.graphics.AnimatedSprite;
import me.gijspennings.jumpandduck.graphics.Screen;
import me.gijspennings.jumpandduck.graphics.Sprite;
import me.gijspennings.jumpandduck.level.Level;

public abstract class Mob extends Entity {
    
    protected Sprite sprite;
    protected int x, y;
    
    public Mob(Level level, Sprite sprite, int x, int y) {
        super(level);
        this.sprite = sprite;
        this.x = x;
        this.y = y;
    }
    
    public void update() {
        if (sprite instanceof AnimatedSprite) ((AnimatedSprite) sprite).update();
    }
    public void render(Screen screen) {
        screen.renderMob(this, x, y);
    }
    
    private boolean collision() {
        return false;
    }
    
    public Sprite getSprite() {
        return sprite;
    }
    
}
